interface DemoStore {
  test: number
}

export const useTestStore = defineStore({
  id: 'demo',
  state: (): DemoStore => ({
    test: 0,
  }),
  actions: {
    changeTest() {
      this.test++
    },
  },
  // 持久化插件
  persist: {
    enabled: true,
    strategies: [
      {
        key: 'test',
        storage: localStorage,
      },
    ],
  },
})
